
const initEditResult = {
  formDef: {
    components: [{
      condType: 'lt',
      component: {
        type: "sfInput",
        name: "输入框1",
        code: "mytext1"
      }
    },
    {
      condType: 'lt',
      component: {
        type: "sfSelect",
        name: "输入框2",
        code: "myselect2",
        options: [{
          label: '选择1',
          value: 1
        },{
          label: '选择2',
          value: 2
        }]
      }
    },
    {
      condType: 'between ',
      component: {
        type: "sfDateRange",
        name: "日期区间3",
        codeStart: "dateStart",
        codeEnd: "dateEnd"
      }
    }
    ],

    initCreateUrl: "/api/simpleFormData/initCreate", //新增初始化
    initUpdateUrl: "/api/simpleFormData/initUpdate", //新增初始化
    draftUrl: "/api/simpleFormData/doDraft", //草稿地址
    submitUrl: "/api/simpleFormData/doSubmit", //提交地址

  },

  formData: {
    id: null,
    mytext1: null,
    myselect2: null,
    dateStart: null,
    dateEnd: null,
  },

};

export default {
  initForm(queryFormCode) {
    console.log("initForm",queryFormCode);
    // /api/simpleFormData/initQuery?code=$queryFormCode
    const promise = new Promise((resolve) => {
      setTimeout(() => {
        resolve({
          code: 0,
          data: initQueryFormResult
        });
  //        reject(`失败！数字是：${randomNumber}`);
      }, 1000);
    });
    return promise;
  },

  actionQueryFn(url,queryFormCode,queryFormData) {
    console.log("actionQueryFn", url, queryFormCode, queryFormData);
    // post actionDef.url
    const promise = new Promise((resolve) => {
      setTimeout(() => {
        resolve({
          code: 0,
          data: null
        });
  //        reject(`失败！数字是：${randomNumber}`);
      }, 1000);
    });
    return promise;
  },

  actionIdsFn(url,queryFormCode,ids) {
    console.log("actionIdsFn",url,queryFormCode,ids);
    // post actionDef.url
    const promise = new Promise((resolve) => {
      setTimeout(() => {
        resolve({
          code: 0,
          data: null
        });
  //        reject(`失败！数字是：${randomNumber}`);
      }, 1000);
    });
    return promise;
  },

  queryForm(url,queryFormCode,queryFormData){
    console.log("queryForm",url,queryFormCode,queryFormData);
    // post actionDef.url
    const promise = new Promise((resolve) => {
      setTimeout(() => {
        resolve({
          code: 0,
          message: "嘎了",
          data: queryFormResult
        });
  //        reject(`失败！数字是：${randomNumber}`);
      }, 1000);
    });
    return promise;
  }
}